<?php

/**
 * TipoCategoria form base class.
 *
 * @package    form
 * @subpackage tipo_categoria
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseTipoCategoriaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_tipo_categoria' => new sfWidgetFormInputHidden(),
      'id_categoria'      => new sfWidgetFormDoctrineChoice(array('model' => 'Categoria', 'add_empty' => true)),
      'id_tipo'           => new sfWidgetFormDoctrineChoice(array('model' => 'Tipo', 'add_empty' => true)),
      'created_at'        => new sfWidgetFormDateTime(),
      'updated_at'        => new sfWidgetFormDateTime(),
      'deleted'           => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id_tipo_categoria' => new sfValidatorDoctrineChoice(array('model' => 'TipoCategoria', 'column' => 'id_tipo_categoria', 'required' => false)),
      'id_categoria'      => new sfValidatorDoctrineChoice(array('model' => 'Categoria', 'required' => false)),
      'id_tipo'           => new sfValidatorDoctrineChoice(array('model' => 'Tipo', 'required' => false)),
      'created_at'        => new sfValidatorDateTime(array('required' => false)),
      'updated_at'        => new sfValidatorDateTime(array('required' => false)),
      'deleted'           => new sfValidatorBoolean(),
    ));

    $this->widgetSchema->setNameFormat('tipo_categoria[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'TipoCategoria';
  }

}
